from queue import Queue
q = Queue()

q.put(1)
q.put(2)
q.put(3)
# 1.队列加入元素
q.put(4)
# 2.队列删除元素
q.get()
# 3.遍历
while not q.empty():
    num = q.get()
    print(f"队列中遍历元素:{num}")
# 4.判断队列的长度
q.qsize()
# 5.判断队列是否为空
q.empty()
